CREATE TABLE t_2262(c1 int);
INSERT INTO t_2262 VALUES (42);
GO

CREATE TABLE t_2262_2(c2 int);
GO

CREATE PROCEDURE p_2262
  @pCursor CURSOR VARYING OUTPUT
AS
BEGIN
  DECLARE @c1 INT;
  FETCH NEXT FROM @pCursor INTO @c1
  INSERT INTO t_2262_2 VALUES (@c1);
END
GO

DECLARE @cur CURSOR FOR SELECT c1 FROM t_2262;
OPEN @cur;
EXEC p_2262 @cur OUTPUT;
CLOSE @cur;
DEALLOCATE @cur;
GO

SELECT c2 from t_2262_2;
GO

CREATE FUNCTION f_2262 (@pCursor CURSOR VARYING OUTPUT)
RETURNS INT
AS
BEGIN
  DECLARE @c1 INT;
  FETCH NEXT FROM @pCursor INTO @c1
  RETURN @c1 + 1;
END;
GO

DROP PROC p_2262;
DROP TABLE t_2262;
DROP TABLE t_2262_2;
GO
